import Main from '@/components/main'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  title: { String|Number|Function }
 *         显示在侧边栏、面包屑和标签栏的文字
 *         使用'{{ 多语言字段 }}'形式结合多语言使用，例子看多语言的路由配置;
 *         可以传入一个回调函数，参数是当前路由对象，例子看动态路由和带参路由
 *  hideInBread: (false) 设为true后此级路由将不会出现在面包屑中，示例看QQ群路由配置
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面在切换标签后不会缓存，如果需要缓存，无需设置这个字段，而且需要设置页面组件name属性和路由配置的name一致
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 *  beforeCloseName: (-) 设置该字段，则在关闭当前tab页时会去'@/router/before-close.js'里寻找该字段名对应的方法，作为关闭前的钩子函数
 * }
 */

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/view/Login/Login')
  },
  {
    path: '/',
    name: '_home',
    redirect: '/home',
    component: Main,
    meta: {
      hideInMenu: true,
      notCache: true
    },
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          hideInMenu: true,
          title: '首页',
          notCache: true,
          icon: 'md-home'
        },
        component: () => import('@/view/Home/CommandDispatch')
      }
    ]
  },
  {
    path: '/command_center',
    name: 'command_center',
    meta: {
      icon: 'ios-construct',
      title: '指挥调度'
    },
    component: Main,
    children: [
      {
        path: '/map/dispatch',
        name: 'map_dispatch',
        meta: {
          title: '地图监控'
        },
        component: () => import('@/view/MonitoringCenter/Dispatch')
      },
      {
        path: '/replaying/track',
        name: 'replaying_track',
        meta: {
          title: '轨迹回放'
        },
        component: () => import('@/view/MonitoringCenter/Trackreplay')
      },
      {
        path: '/multi/screen',
        name: 'multi_screen',
        meta: {
          title: '多屏监控'
        },
        component: () => import('@/view/MonitoringCenter/MultiScreenPlay')
      },
      {
        path: '/electronic/fence',
        name: 'fence_fence',
        meta: {
          title: '电子围栏'
        },
        component: () => import('@/view/MonitoringCenter/ElectronicFence')
      },
      {
        path: '/actual/distribute',
        name: 'actual_distribute',
        meta: {
          title: '人力分布'
        },
        component: () => import('@/view/MonitoringCenter/DeviceDistribute')
      },
    ]
  },
  {
    path: '/device_maintain',
    name: 'device_maintain',
    meta: {
      icon: 'ios-construct',
      title: '设备管理'
    },
    component: Main,
    children: [
      {
        path: '/gb_server_reg',
        name: 'gb_server_reg',
        meta: {
          title: '国标服务器注册'
        },
        component: () => import('@/view/GbServer/GbServer')
      },
      {
        path: '/mobile_dev_reg',
        name: 'mobile_dev_reg',
        meta: {
          title: '4G执法仪注册'
        },
        component: () => import('@/view/Device/Device4g')
      },
      {
        path: '/common_dev_common_reg',
        name: 'common_dev_common_reg',
        meta: {
          title: '普通执法仪注册'
        },
        component: () => import('@/view/Device/DeviceCommon')
      },
      {
        path: '/xeoma/dev/reg',
        name: 'xeoma_dev_reg',
        meta: {
          title: '摄像机NVR注册'
        },
        component: () => import('@/view/Device/DeviceXeomas')
      },
      {
        path: 'collect/site/reg',
        name: 'site_reg',
        meta: {
          title: '采集站点注册'
        },
        component: () => import('@/view/Device/Site')
      },
      {
        path: '/storage/server/reg',
        name: 'storage_reg',
        meta: {
          title: '集中存储服务器注册'
        },
        component: () => import('@/view/Device/StorageSite')
      },
    ]
  },
  {
    path: '/archives/maintain',
    name: 'document_maintain',
    meta: {
      icon: 'ios-construct',
      title: '档案管理'
    },
    component: Main,
    children: [
      {
        path: '/document/doc/mn',
        name: '/document_doc_mn',
        meta: {
          title: '文件管理'
        },
        component: () => import('@/view/Document/Document')
      },
      {
        path: '/document/doc/upload',
        name: '/document_doc_upload',
        meta: {
          title: '文件上传'
        },
        component: () => import('@/view/Document/UploadFile')
      },
      {
        path: '/document/achives/mn',
        name: '/document_achives_mn',
        meta: {
          title: '档案管理'
        },
        component: () => import('@/view/Document/Achives')
      },
      {
        path: '/document/achives/related',
        name: '/document_achives_related',
        meta: {
          title: '档案关联'
        },
        component: () => import('@/view/Document/AchivesRelated')
      },
    ]
  },
  {
    path: '/system_maintain',
    name: 'system_maintain',
    meta: {
      icon: 'ios-construct',
      title: '系统管理'
    },
    component: Main,
    children: [
      {
        path: '/organization_reg',
        name: 'organization_reg',
        meta: {
          title: '组织机构注册'
        },
        component: () => import('@/view/Organization/Organization')
      },
      {
        path: '/user_reg',
        name: 'user_reg',
        meta: {
          title: '人员注册'
        },
        component: () => import('@/view/User/User')
      },

      {
        path: '/user/role/reg',
        name: 'user_role_reg',
        meta: {
          title: '权限角色'
        },
        component: () => import('@/view/User/Role')
      },
      {
        path: '/user/dictionaries/reg',
        name: 'user_dictionaries_reg',
        meta: {
          title: '字典管理'
        },
        component: () => import('@/view/System/Dictionaries')
      },
      {
        path: '/sys/config/setting',
        name: 'sys_config_setting',
        meta: {
          title: '系统参数设置'
        },
        component: () => import('@/view/System/SysConfig')
      },
      {
        path: '/update/account/password/page',
        name: 'update_account_password_page',
        meta: {
          icon: 'md-contact',
          title: '修改账号密码'
        },
        component: () => import('@/view/User/ChangePassword')
      },

      {
        path: '/blacklist_page',
        name: 'blacklist_page',
        meta: {
          icon: 'ios-stopwatch',
          title: '黑名单管理'
        },
        component: () => import('@/view/Blacklist/Blacklist')
      },
      {
        path: '/api_log_page',
        name: 'api_log_page',
        meta: {
          icon: 'ios-book',
          title: '日志查询'
        },
        component: () => import('@/view/ApiLog/ApiLog')
      }
    ]
  },
]
